<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Sets the mode of iteration</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="splqueue.enqueue.html">SplQueue::enqueue</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.splheap.html">SplHeap</a></div>
 <div class="up"><a href="class.splqueue.html">SplQueue</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="splqueue.setiteratormode" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SplQueue::setIteratorMode</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0)</p><p class="refpurpose"><span class="refname">SplQueue::setIteratorMode</span> &mdash; <span class="dc-title">Sets the mode of iteration</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-splqueue.setiteratormode-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>SplQueue::setIteratorMode</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$mode</code></span>
   )</div>

 </div>


 <div class="refsect1 parameters" id="refsect1-splqueue.setiteratormode-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">mode</code></em></dt>

     <dd>

      <p class="para">
       There is only one iteration parameter you can modify.
      </p>
      <ul class="itemizedlist">
       <li class="listitem">
        <span class="simpara">The behavior of the iterator (either one or the other):</span>
        <ul class="itemizedlist">
         <li class="listitem"><span class="simpara"><strong><code>SplDoublyLinkedList::IT_MODE_DELETE</code></strong> (Elements are deleted by the iterator)</span></li>
         <li class="listitem"><span class="simpara"><strong><code>SplDoublyLinkedList::IT_MODE_KEEP</code></strong> (Elements are traversed by the iterator)</span></li>
        </ul>
       </li>
      </ul>

      <p class="para">
       The default mode is: <strong><code>SplDoublyLinkedList::IT_MODE_FIFO</code></strong> | <strong><code>SplDoublyLinkedList::IT_MODE_KEEP</code></strong>
      </p>

      <div class="warning"><strong class="warning">Warning</strong>
       <p class="para">
        The direction of iteration can not be changed for SplQueues, it is always <strong><code>SplDoublyLinkedList::IT_MODE_FIFO</code></strong>.
       </p>
      </div>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-splqueue.setiteratormode-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   没有返回值。
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-splqueue.setiteratormode-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   Throws a <a href="class.runtimeexception.html" class="classname">RuntimeException</a> on trying to change the direction of iteration by using <strong><code>SplDoublyLinkedList::IT_MODE_LIFO</code></strong>.
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="splqueue.enqueue.html">SplQueue::enqueue</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.splheap.html">SplHeap</a></div>
 <div class="up"><a href="class.splqueue.html">SplQueue</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
